package com.weixing.mall.provider.api.service;

import com.weixing.mall.base.wrapper.Result;
import com.weixing.mall.provider.api.fallback.CartFeignFallback;
import com.weixing.mall.provider.api.model.vo.ItemVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.ribbon.FeignRibbonClientAutoConfiguration;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Author: kfc
 * @Description: <br/>
 * Date:Create in 2019/10/9 15:49
 * @Modified By:
 */
@FeignClient(value = "mall-provider-goods", configuration = FeignRibbonClientAutoConfiguration.class, fallback = CartFeignFallback.class)
public interface CartFeign {
    @GetMapping("/api/cart/loadSelectedItem")
    Result<List<ItemVo>> loadSelectedItem(@RequestParam(value = "memberId") long memberId);
    @PostMapping("/api/cart/removeItemFromCart")
//    Result removeItemFromCart(@RequestParam(value = "cartItemIdsJsonStr") String  cartItemIdsJsonStr);
    Result removeItemFromCart(@RequestBody List<Long>  cartItemIds);
}
